package com.yykj.hospital.server.model.entity.qrcode;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.time.LocalDateTime;

@Data
@Entity
//@Table(
//        uniqueConstraints = {
//                @UniqueConstraint(columnNames = {"projectId", "jobNo"}),
//        }
//)
public class DoctorQrcode {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer qrId;

    @ApiModelProperty("医院ID")
    private Integer hospitalId;

    @ApiModelProperty("医生ID")
    @Column(unique = true)
    private String doctorId;

    @ApiModelProperty("扩展json字段")
    private String ext;

    @ApiModelProperty("添加修改时间")
    @UpdateTimestamp
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime addTime;
}
